package com.my.study.aqs;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Carlos
 * @version 1.0
 * @Description TODO
 * @date 2021/6/19 9:10
 **/
@Slf4j(topic = "c.TestStampedLock")
public class TestStampedLock {

    public static void main(String[] args) throws InterruptedException {
        DataContainerStamped dataContainer = new DataContainerStamped(10);

        new Thread(() -> {
            int read = dataContainer.read(1);
            log.debug("读取的结果：{}", read);
        }, "t1").start();
        Thread.sleep(500);
        new Thread(() -> {
            int read = dataContainer.read(0);
            log.debug("读取的结果：{}", read);
        }, "t1").start();
    }

}
